<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  <title>tango.io.model.IConduit</title>
  <link href="./css/style.css" rel="stylesheet" type="text/css"/>
  <!-- <link href="./img/icon.png" rel="icon" type="image/png"/> -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/modules.js"></script>
  <script type="text/javascript" src="./js/quicksearch.js"></script>
  <script type="text/javascript" src="./js/navigation.js"></script>
  <!--<script type="text/javascript" src="./js/jquery.treeview.js"></script>-->
  <script type="text/javascript">
    var g_moduleFQN = "tango.io.model.IConduit";
  </script>
  
</head>
<body>
<div id="content">
  <h1><a href="./htmlsrc/tango.io.model.IConduit.html" class="symbol">tango.io.model.IConduit</a></h1>
  
<p class="sec_header">License:</p>BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a>
<p class="sec_header">Version:</p>Initial release: March 2004      
                        Outback release: December 2006
<p class="sec_header">Author:</p>Kris
<dl>
<dt class="decl">interface <a class="symbol _interface" name="IConduit" href="./htmlsrc/tango.io.model.IConduit.html#L31" kind="interface" beg="31" end="118">IConduit</a> : InputStream, OutputStream; <a title="Permalink to this symbol" href="#IConduit" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L31">#</a></dt>
<dd class="ddef">
<div class="summary">Conduits provide virtualized access to external content, and 
        represent things like files or Internet connections. Conduits 
        expose a pair of streams, are modelled by tango.io.model.IConduit, 
        and are implemented via classes such as FileConduit &amp; SocketConduit. 
        
        Additional kinds of conduit are easy to construct: one either 
        subclasses tango.io.Conduit, or implements tango.io.model.IConduit. 
        A conduit typically reads and writes from/to an IBuffer in large 
        chunks, typically the entire buffer. Alternatively, one can invoke 
        input.read(dst[]) and/or output.write(src[]) directly.</div>
<dl>
<dt class="decl">InputStream <a class="symbol _function" name="IConduit.input" href="./htmlsrc/tango.io.model.IConduit.html#L39" kind="function" beg="39" end="39">input</a><span class="params">()</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.input" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L39">#</a></dt>
<dd class="ddef">
<div class="summary">Return the input stream</div></dd>
<dt class="decl">OutputStream <a class="symbol _function" name="IConduit.output" href="./htmlsrc/tango.io.model.IConduit.html#L47" kind="function" beg="47" end="47">output</a><span class="params">()</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.output" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L47">#</a></dt>
<dd class="ddef">
<div class="summary">Return the output stream</div></dd>
<dt class="decl">uint <a class="symbol _function" name="IConduit.bufferSize" href="./htmlsrc/tango.io.model.IConduit.html#L55" kind="function" beg="55" end="55">bufferSize</a><span class="params">()</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.bufferSize" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L55">#</a></dt>
<dd class="ddef">
<div class="summary">Return a preferred size for buffering conduit I/O</div></dd>
<dt class="decl">char[] <a class="symbol _function" name="IConduit.toString" href="./htmlsrc/tango.io.model.IConduit.html#L63" kind="function" beg="63" end="63">toString</a><span class="params">()</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.toString" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L63">#</a></dt>
<dd class="ddef">
<div class="summary">Return the name of this conduit</div></dd>
<dt class="decl">bool <a class="symbol _function" name="IConduit.isAlive" href="./htmlsrc/tango.io.model.IConduit.html#L71" kind="function" beg="71" end="71">isAlive</a><span class="params">()</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.isAlive" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L71">#</a></dt>
<dd class="ddef">
<div class="summary">Is the conduit alive?</div></dd>
<dt class="decl">void <a class="symbol _function" name="IConduit.detach" href="./htmlsrc/tango.io.model.IConduit.html#L79" kind="function" beg="79" end="79">detach</a><span class="params">()</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.detach" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L79">#</a></dt>
<dd class="ddef">
<div class="summary">Release external resources</div></dd>
<dt class="decl">void <a class="symbol _function" name="IConduit.error" href="./htmlsrc/tango.io.model.IConduit.html#L87" kind="function" beg="87" end="87">error</a><span class="params">(char[] <em>msg</em>)</span>; <span class="attrs">[<span class="stc">abstract</span>]</span> <a title="Permalink to this symbol" href="#IConduit.error" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L87">#</a></dt>
<dd class="ddef">
<div class="summary">Throw a generic IO exception with the provided msg</div></dd>
<dt class="decl">interface <a class="symbol _interface" name="IConduit.Seek" href="./htmlsrc/tango.io.model.IConduit.html#L95" kind="interface" beg="95" end="117">Seek</a>; <a title="Permalink to this symbol" href="#IConduit.Seek" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L95">#</a></dt>
<dd class="ddef">
<div class="summary">Models the ability to seek within a conduit</div>
<dl>
<dt class="decl">enum <a class="symbol _enum" name="IConduit.Seek.Anchor" href="./htmlsrc/tango.io.model.IConduit.html#L103" kind="enum" beg="103" end="107">Anchor</a>; <a title="Permalink to this symbol" href="#IConduit.Seek.Anchor" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L103">#</a></dt>
<dd class="ddef">
<div class="summary">The anchor positions supported by seek()</div>
</dd>
<dt class="decl">long <a class="symbol _function" name="IConduit.Seek.seek" href="./htmlsrc/tango.io.model.IConduit.html#L116" kind="function" beg="116" end="116">seek</a><span class="params">(long <em>offset</em>, Anchor <em>anchor</em> = Anchor.Begin)</span>; <a title="Permalink to this symbol" href="#IConduit.Seek.seek" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L116">#</a></dt>
<dd class="ddef">
<div class="summary">Move the file position to the given offset from the 
                        provided anchor point, and return adjusted position.</div></dd></dl></dd></dl></dd>
<dt class="decl">interface <a class="symbol _interface" name="ISelectable" href="./htmlsrc/tango.io.model.IConduit.html#L127" kind="interface" beg="127" end="141">ISelectable</a>; <a title="Permalink to this symbol" href="#ISelectable" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L127">#</a></dt>
<dd class="ddef">
<div class="summary">Describes how to make an IO entity usable with selectors</div>
<dl>
<dt class="decl">typedef int <a class="symbol _typedef" name="ISelectable.Handle" href="./htmlsrc/tango.io.model.IConduit.html#L129" kind="typedef" beg="129" end="129">Handle</a>; <a title="Permalink to this symbol" href="#ISelectable.Handle" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L129">#</a></dt>
<dd class="ddef">
<div class="summary">opaque OS file-handle</div></dd>
<dt class="decl">Handle <a class="symbol _function" name="ISelectable.fileHandle" href="./htmlsrc/tango.io.model.IConduit.html#L140" kind="function" beg="140" end="140">fileHandle</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#ISelectable.fileHandle" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L140">#</a></dt>
<dd class="ddef">
<div class="summary">Models a handle-oriented device.</div>
<p class="sec_header">TODO:</p>figure out how to avoid exposing this in the general
                case</dd></dl></dd>
<dt class="decl">interface <a class="symbol _interface" name="IOStream" href="./htmlsrc/tango.io.model.IConduit.html#L150" kind="interface" beg="150" end="173">IOStream</a>; <a title="Permalink to this symbol" href="#IOStream" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L150">#</a></dt>
<dd class="ddef">
<div class="summary">The common attributes of streams</div>
<dl>
<dt class="decl">IConduit <a class="symbol _function" name="IOStream.conduit" href="./htmlsrc/tango.io.model.IConduit.html#L163" kind="function" beg="163" end="163">conduit</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#IOStream.conduit" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L163">#</a></dt>
<dd class="ddef">
<div class="summary">Return the host conduit</div></dd>
<dt class="decl">void <a class="symbol _function" name="IOStream.close" href="./htmlsrc/tango.io.model.IConduit.html#L172" kind="function" beg="172" end="172">close</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#IOStream.close" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L172">#</a></dt>
<dd class="ddef">
<div class="summary">Close the input</div></dd></dl></dd>
<dt class="decl">interface <a class="symbol _interface" name="InputStream" href="./htmlsrc/tango.io.model.IConduit.html#L182" kind="interface" beg="182" end="217">InputStream</a> : IOStream; <a title="Permalink to this symbol" href="#InputStream" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L182">#</a></dt>
<dd class="ddef">
<div class="summary">The Tango input stream</div>
<dl>
<dt class="decl">uint <a class="symbol _function" name="InputStream.read" href="./htmlsrc/tango.io.model.IConduit.html#L195" kind="function" beg="195" end="195">read</a><span class="params">(void[] <em>dst</em>)</span>; <a title="Permalink to this symbol" href="#InputStream.read" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L195">#</a></dt>
<dd class="ddef">
<div class="summary">Read from stream into a target array. The provided dst 
                will be populated with content from the stream.</div>
Returns the number of bytes read, which may be less than
                requested in dst. Eof is returned whenever an end-of-flow 
                condition arises.</dd>
<dt class="decl">void[] <a class="symbol _function" name="InputStream.load" href="./htmlsrc/tango.io.model.IConduit.html#L208" kind="function" beg="208" end="208">load</a><span class="params">(void[] <em>dst</em> = null)</span>; <a title="Permalink to this symbol" href="#InputStream.load" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L208">#</a></dt>
<dd class="ddef">
<div class="summary">Load the bits from a stream, and return them all in an
                array. The dst array can be provided as an option, which
                will be expanded as necessary to consume the input.</div>
Returns an array representing the content, and throws
                IOException on error</dd>
<dt class="decl">InputStream <a class="symbol _function" name="InputStream.clear" href="./htmlsrc/tango.io.model.IConduit.html#L216" kind="function" beg="216" end="216">clear</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#InputStream.clear" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L216">#</a></dt>
<dd class="ddef">
<div class="summary">Clear any buffered content</div></dd></dl></dd>
<dt class="decl">interface <a class="symbol _interface" name="OutputStream" href="./htmlsrc/tango.io.model.IConduit.html#L226" kind="interface" beg="226" end="257">OutputStream</a> : IOStream; <a title="Permalink to this symbol" href="#OutputStream" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L226">#</a></dt>
<dd class="ddef">
<div class="summary">The Tango output stream</div>
<dl>
<dt class="decl">uint <a class="symbol _function" name="OutputStream.write" href="./htmlsrc/tango.io.model.IConduit.html#L239" kind="function" beg="239" end="239">write</a><span class="params">(void[] <em>src</em>)</span>; <a title="Permalink to this symbol" href="#OutputStream.write" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L239">#</a></dt>
<dd class="ddef">
<div class="summary">Write to stream from a source array. The provided src
                content will be written to the stream.</div>
Returns the number of bytes written from src, which may
                be less than the quantity provided. Eof is returned when 
                an end-of-flow condition arises.</dd>
<dt class="decl">OutputStream <a class="symbol _function" name="OutputStream.copy" href="./htmlsrc/tango.io.model.IConduit.html#L248" kind="function" beg="248" end="248">copy</a><span class="params">(InputStream <em>src</em>)</span>; <a title="Permalink to this symbol" href="#OutputStream.copy" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L248">#</a></dt>
<dd class="ddef">
<div class="summary">Transfer the content of another stream to this one. Returns
                a reference to this class, and throws IOException on failure.</div></dd>
<dt class="decl">OutputStream <a class="symbol _function" name="OutputStream.flush" href="./htmlsrc/tango.io.model.IConduit.html#L256" kind="function" beg="256" end="256">flush</a><span class="params">()</span>; <a title="Permalink to this symbol" href="#OutputStream.flush" class="symlink">¶</a><a title="Go to the HTML source file" class="srclink" href="./htmlsrc/tango.io.model.IConduit.html#L256">#</a></dt>
<dd class="ddef">
<div class="summary">Purge buffered content</div></dd></dl></dd></dl>
</div>
<div id="footer">
  <p>Copyright (c) 2004 Kris Bell. All rights reserved</p>
  <p>Page generated by <a href="http://code.google.com/p/dil">dil</a> on Fri Dec 26 04:04:01 2008. Rendered by <a href="http://code.google.com/p/dil/wiki/Kandil">kandil</a>.</p>
</div>
</body>
</html>